<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/res/layui/css/layui.css" media="all">
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label"> 角色名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" disabled readonly  autocomplete="off" class="layui-input" value="{$role.name}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"> 选择权限</label>
        <div class="layui-input-block">
            <div id="menu-tree"></div>
        </div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" value="{$role.id}">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="确认添加">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认编辑">
    </div>
</div>

<script src="__STATIC__/res/layui/layui.js"></script>
<script>
    layui.config({
        base: '__STATIC__/res/' //静态资源所在路径
    }).use(['index', 'form','tree'],function (){
        var tree = layui.tree;

        //基本演示
        tree.render({
            elem: '#menu-tree'
            ,data: JSON.parse('{$menuTree|raw}')
            ,showCheckbox: true  //是否显示复选框
            ,id: 'menu-tree'
        });
    })
</script>
</body>
</html>